cc.Class({
    extends: cc.Component,
    properties: {
        mask: cc.Node,
        title: cc.Label,
        image: cc.Node
    },
    onLoad: function () {
        var t = this;
        this.node.on(cc.Node.EventType.TOUCH_START, function (e) {
            var n = e.getTouches()[0].getLocation();
            t.rect && t.rect.contains(n) && (console.log("star2"), console.log(t.touchTrue),
                t.rect = null, t.touchTrue && t.canvas.emit(cc.Node.EventType.TOUCH_START, e), t.callback());
        }, this);
    },
    open: function () {
        this.node.active = !0;
    },
    close: function () {
        this.node.active = !1;
    },
    no: function () {
        this.mask.width = 0, this.mask.height = 0, this.image.active = !1, this.title.string = "";
    },
    set: function (t) {
        this.image.active = !0, this.title.string = t.string, this.callback = t.callback,
            this.canvas = t.canvas;
        var e = this.getPos(t.pos);
        this.mask.position = e, this.touchTrue = t.touchTrue, this.mask.width = t.rect.width,
            this.mask.height = t.rect.height, this.rect = t.rect, this.rect.xMin -= 20, this.rect.yMin -= 20,
            this.rect.xMax += 20, this.rect.yMax += 20, this.image.position = cc.v2(this.mask.position.x + this.image.width, this.mask.position.y - this.image.height);
    },
    getPos: function (t) {
        return this.node.convertToNodeSpaceAR(t);
    }
})